package com.imddysc.springbootmultidatasources.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.imddysc.springbootmultidatasources.secondentity.Teacher;
import com.imddysc.springbootmultidatasources.secondrepository.TeacherRepository;

@Controller
@RequestMapping("/t2")
public class T2Controller {

	@Autowired
	private TeacherRepository teacherRepository;

	@ResponseBody
	@RequestMapping("/getAll")
	public List<Teacher> getAll() {
		return teacherRepository.findAll();
	}
	
}
